import React from 'react'
import {Modal,Form,Input} from 'antd'
const FormItem = Form.Item;
const formItemLayout = {
    labelCol: {
        span: 8,
    },
    wrapperCol: {
        span: 14,
    }
};

class AddSchool extends React.Component{
    render(){
        const {visible,onOk,onCancel,form,data} = this.props;
        console.log(data)
        const { getFieldDecorator } = form;
        return (
            <Modal
                title="新增学校" 
                visible={visible}
                onOk={onOk}
                onCancel={onCancel}
                okText="确认"
                cancelText="取消"
            >
                <Form>
                    <FormItem label="学校" {...formItemLayout}>
                        {getFieldDecorator('school', {
                            initialValue: data.school,
                            rules: [
                                { required: true, message: '学校名称不得为空' },
                            ],
                        })(
                            <Input placeholder="请输入学校名称"/>
                        )}
                    </FormItem>
                </Form>
            </Modal>
        )
    }
}

export default Form.create()(AddSchool)